#include <bits/stdc++.h>
using namespace std;
int a[300005];
int n;
int k;
int ma;
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++){
		int x;
		cin>>x;
		a[x]++;
		ma=max(ma,x);
	}
	for(int i=1;i<=ma;i++){
		if(a[i]>k)k=0;
		else k-=a[i];
		k+=a[i];
	}
	cout<<k;
	return 0;
}
